<!DOCTYPE html>
<html lang="en">
<script>
  // 防止用户通过更改网址直接访问页面
  if (!localStorage.getItem('token')) {
    location.href = './login.html'
  }
</script>

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link rel="stylesheet" href="./assets/lib/layui/css/layui.css">
  <title>首页</title>
</head>
<style>
  .layui-icon {
    font-size: 16px;
    margin-right: 10px;
  }

  .layui-icon-app {
    margin-left: 15px;
  }

  #indexUsername {
    height: 60px;
    font-size: 12px;
    color: #fff;
    line-height: 60px;
    text-align: center;
  }

  .layui-nav-img {
    width: 40px;
    height: 40px;
  }

  .layui-footer {
    text-align: center;
    font-size: 12px;
  }

  #container,
  iframe {
    width: 100%;
    height: 100%;
  }

  #container {
    background-color: #F2F3F5;
    overflow: hidden;
  }

  .Head-portrait {
    display: inline-block;
    width: 40px;
    height: 40px;
    background-color: #009688;
    border-radius: 50%;
    line-height: 40px;
    text-align: center;
    font-size: 20px;
    color: #fff;
    position: relative;
    margin-right: 10px;
    vertical-align: middle;
  }

  .Head-portrait,
  .layui-nav-img {
    display: none;
  }
</style>

<body class="layui-layout-body">
  <div class="layui-layout layui-layout-admin">
    <div class="layui-header">
      <div class="layui-logo">后台管理系统</div>
      <!-- 头部区域（可配合layui已有的水平导航） -->

      <ul class="layui-nav layui-layout-right">
        <li>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;" class="avatars">
            <!-- 头像 -->
            <img class="layui-nav-img" src="./assets/images/sample.jpg" style="display:inline-block;">

            黑马
          </a>
        </li>
        <li class="layui-nav-item">
          <a href="javascript:;" id="logout-btn">
            <i></i>
            退出
          </a>
        </li>
      </ul>
    </div>

    <div class="layui-side layui-bg-black">
      <div class="layui-side-scroll">

        <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
        <ul class="layui-nav layui-nav-tree" lay-filter="test" lay-shrink="all">
          <li class="layui-nav-item layui-this"><a href=""><i></i>首页</a></li>
          <li class="layui-nav-item">
            <a class="" href="javascript:;"><i></i>用户管理</a>
            <dl class="layui-nav-child">
              <dd><a href="./user/user.html" target="main_frame"><i></i>用户列表</a></dd>
              <dd><a href="./user/add.html" target="main_frame"><i></i>添加用户</a></dd>
            </dl>
          </li>
          <li class="layui-nav-item">
            <a href="javascript:;"><i></i>资源管理</a>
            <dl class="layui-nav-child">
              <dd><a href="./link/link.html" target="main_frame"><i></i>友情链接</a></dd>
              <dd><a href="./swiper/swiper.html" target="main_frame"><i></i>轮播图</a></dd>
              <dd><a href="./comment/comment.html" target="main_frame"><i></i>评论管理</a></dd>
            </dl>
          </li>
        </ul>
      </div>
    </div>

    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="padding: 0px;" id="container">
        <iframe src="./home/dashboard.html" frameborder="0" name="main_frame" class="layadmin-iframe"></iframe>
      </div>
    </div>

    <div class="layui-footer">
      <!-- 底部固定区域 -->
      © www.itheima.com - 黑马程序员
    </div>
  </div>
  <script src="./assets/lib/jquery.js"></script>
  <script src="./assets/lib/jquery.particleground.min.js"></script>
  <script src="./assets/lib/layui/layui.all.js"></script>
  <script src="./assets/js/common.js"></script>
  <script src="./assets/js/index.js"></script>
</body>

</html>